package cn.sofwin.day0107;

import java.util.Scanner;

public class Test02 {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        System.out.println("1.登录系统");
        System.out.println("2.退出");
        System.out.print("请输入选择：");
        int choice = sc.nextInt();
        switch (choice) {
            case 1:
                mainMenu();
                break;
            case 2:
                return;
            default:
                System.out.println("输入出错");
                main(null);
        }
    }

    static void mainMenu() {
        System.out.println("1.客户信息管理");
        System.out.println("2.购物结算");
        System.out.println("3.真情回馈");
        System.out.println("4.注销");
        System.out.print("请输入选择：");
        int choice = sc.nextInt();
        switch (choice) {
            case 1:
                userInfoManagement();
                break;
            case 2:
                break;
            case 3:
                reback();
                break;
            case 4:
                main(null);
                break;
            default:
                System.out.println("输入出错,返回上级菜单");
                main(null);
        }
    }

    static void userInfoManagement() {
        System.out.println("1.显示所有客户信息");
        System.out.println("2.添加客户信息");
        System.out.println("3.修改客户信息");
        System.out.println("4.查询客户信息");
        System.out.println("5.返回上级菜单");
        int choice = sc.nextInt();
        switch (choice){
            case 1:
            case 2:
            case 3:
            case 4:
                break;
            case 5:
                mainMenu();
                break;
            default:
                System.out.println("输入出错，返回上级菜单");
                mainMenu();
        }
    }

    static void reback() {
        System.out.println("1.幸运大放送");
        System.out.println("2.幸运抽奖");
        System.out.println("3.生日问候");
        System.out.println("4.返回上级菜单");
        int choice = sc.nextInt();
        switch (choice){
            case 1:
            case 2:
            case 3:
                break;
            case 4:
                mainMenu();
                break;
            default:
                System.out.println("输入出错，返回上级菜单");
                mainMenu();
        }
    }
}
